/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Entidades;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.OneToOne;
import javax.persistence.Table;

/**
 *
 * @author diego
 */
@Entity
@Table(name = "Biometria")
public class Biometria implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Basic(optional = false)
    @Column(name = "idBiometria")
    private Integer idBiometria;
    @Column(name = "huellaUsada")
    @Lob
    private byte[] huellaUsada;
    @JoinColumn(name = "idEmpleado", referencedColumnName = "idEmpleado")
    @OneToOne(optional = false)
    private Empleado idEmpleado;

    public Biometria() {
    }

    public Biometria(Integer idBiometria) {
        this.idBiometria = idBiometria;
    }

    public Integer getIdBiometria() {
        return idBiometria;
    }

    public void setIdBiometria(Integer idBiometria) {
        this.idBiometria = idBiometria;
    }

    public byte[] getHuellaUsada() {
        return huellaUsada;
    }

    public void setHuellaUsada(byte[] huellaUsada) {
        this.huellaUsada = huellaUsada;
    }

    public Empleado getIdEmpleado() {
        return idEmpleado;
    }

    public void setIdEmpleado(Empleado idEmpleado) {
        this.idEmpleado = idEmpleado;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idBiometria != null ? idBiometria.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Biometria)) {
            return false;
        }
        Biometria other = (Biometria) object;
        if ((this.idBiometria == null && other.idBiometria != null) || (this.idBiometria != null && !this.idBiometria.equals(other.idBiometria))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Biometria " + idBiometria;
    }
}
